{% extends 'base.html' %}

{% block header %}
  <h1>{% block title %}--编辑 "{{ post['title'] }}"{% endblock %}</h1>
{% endblock %}

{% block content %}
  <form method="post">
    <label for="title">--标题--</label>
    <input name="title" id="title"
      value="{{ request.form['title'] or post['title'] }}" required>

    <label for="body">--正文--</label>

    <textarea name="body" id="body">{{ request.form['body'] or post['body'] }}</textarea>
    <input type="submit" value="保存">

  </form>
  <hr>
  <form action="{{ url_for('blog.delete', id=post['id']) }}" method="post">
    <input class="danger" type="submit" value="删除" onclick="return confirm('确定删除?');">
  </form>
{% endblock %}